package cn.ac.siom.query.service.impl;

import cn.ac.siom.query.dao.CountDAO;
import cn.ac.siom.query.service.CountService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

@Service
public class CountServiceImpl implements CountService {

    @Resource
    private CountDAO countDAO;

    @Override
    public Map findAllCount() throws Exception {
        Integer count_1 = this.countDAO.sourceCount(1);
        Integer count_2 = this.countDAO.sourceCount(2);
        Integer count_3 = this.countDAO.sourceCount(3);
        Integer count_4 = this.countDAO.sourceCount(4);
        Integer count_5 = this.countDAO.sourceCount(5);
        Integer count_6 = this.countDAO.sourceCount(6);
        Integer count_7 = this.countDAO.sourceCount(7);
        Integer count_8 = this.countDAO.sourceCount(8);
        Integer count_9 = this.countDAO.sourceCount(9);

        Map map = new HashMap<>();
        map.put("期刊论文", count_1);
        map.put("会议论文", count_2);
        map.put("学术会议", count_3);
        map.put("图书章节", count_4);
        map.put("科技报告", count_5);
        map.put("主题专家", count_6);
        map.put("专利信息", count_7);
        map.put("学位论文", count_8);
        map.put("图片视屏", count_9);
        return map;
    }
}
